
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<h3>Распоред просторије за датум:</h3>
<br/>
<font><h:messages globalOnly="true"/></font>
<h:form>
    <table>

        <tr>
            <td>Дан:</td>
            <td><h:inputText maxlength="2" value="#{datum.dan}" required="true"
                validator="#{datum.validateDan}"
                id="dan" requiredMessage="Нисте унели дан !"/></td>
            <td><font><h:message for="dan"/></font></td>
        </tr>
        <tr>
            <td>Месец:</td>
            <td><h:inputText maxlength="2" value="#{datum.mesec}" required="true"
                validator="#{datum.validateMesec}"
                id="mesec" requiredMessage="Нисте унели месец !"/></td>
            <td><font><h:message for="mesec"/></font></td>
        </tr>
        <tr>
            <td>Година:</td>
            <td><h:inputText maxlength="4" value="#{datum.godina}" required="true"
                validator="#{datum.validateGodina}"
                id="godina" requiredMessage="Нисте унели годину !"/></td>
            <td><font><h:message for="godina"/></font></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td><h:commandButton  value="Распоред" action="#{datum.raspored}"/></td>
        </tr>
    </table>
</h:form>



<h3>Распоред:</h3>
<br/>

<h:panelGrid border="2"   columns="1" cellspacing="5">

        <h:outputText value="#{datumi[0]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[0]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}"/>
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

        <h:outputText value="#{datumi[1]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[1]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}" />
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

        <h:outputText value="#{datumi[2]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[2]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}"/>
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

        <h:outputText value="#{datumi[3]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[3]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}"/>
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

        <h:outputText value="#{datumi[4]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[4]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}"/>
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

        <h:outputText value="#{datumi[5]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[5]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}"/>
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

        <h:outputText value="#{datumi[6]}"/>
        <h:panelGrid columns="1" cellspacing="5">
        <c:forEach items="#{dani[6]}" var="dan">
            <c:if test="${dan.free==false}">
                <h:outputText value="#{dan}"/>
            </c:if>
            <c:if test="${dan.free==true}">
                <h:form>
                <h:commandLink value="#{dan}" style="color:black" action="#{dan.kprez}" />
                </h:form>
            </c:if>
        </c:forEach>
        </h:panelGrid>

</h:panelGrid>

